package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.pojo.Role;
import com.itheima.service.RoleService_lzl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role_lzl")
public class RoleController_lzl {
    @Reference
    private RoleService_lzl roleService_lzl;

    /*
     * 查询所有
     * */
    @RequestMapping("/findAll")
    public Result findAll(){
        try {
            List<Role> roleList =roleService_lzl.findAll();
            return new Result(true, "获取角色数据成功",roleList);
        } catch (Exception e) {
            return new Result(false,"获取角色数据失败");
        }
    }
}
